﻿@using KPIS.GERP.MVC.Classes

@if (new SsMng().IsLogin() && !string.IsNullOrWhiteSpace(new SsMng().UserName))
{
    var unreadCount = HttpHelper.GetMessageUnreadCount(new SsMng().EmpSeq);
    string titleIis = "กล่องข้อความ (" + unreadCount + ")";
    <text>
    <table align="right" >
        <tr>
            <td  style="color: white; padding: 0 5px 0 5px;">
                @*<img src="~/Images/Icons/person.png" height="12" />&nbsp;*@
                @(new SsMng().UserName)
            </td>
            <td style="width:1px; padding: 0 0 0 0;">
                 <div class="thinLineWithShadow" style="height: 15px;"/>
            </td>
            <td style=" padding: 0 5px 0 5px;">
                <div style='background-color: @(unreadCount > 0 ? "red":"transparent")'>
                    @*<img src="~/Images/Icons/mail-white.png" height="12" />&nbsp;*@
                    @Html.ActionLink(titleIis, "Index", "Message", null, new {@title = "คลิก เพื่อเปิดดูกล่องข้อความ", style="color:white"})
                </div>
            </td>
            <td style="width:1px;padding: 0 0 0 0;">
                 <div class="thinLineWithShadow" style="height: 15px;"/>
            </td>
            <td style=" padding: 0 5px 0 5px;">
                @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", style = "color:white" }))
                {
                    @Html.AntiForgeryToken()
                    <span class="Border">
                        @*<img src="~/Images/Icons/logout.png" height="12" />&nbsp;*@
                        <a href="javascript:document.getElementById('logoutForm').submit()" style="color:white">ออกจากระบบ</a>
                    </span>
                }
            </td>
        </tr>
    </table>
    </text>
}